{% extends "index.html" %}
{% load i18n %}

{% block content %}
<h2 class="headline">{{ startchar|default:"-" }} ({{ students.count }})</h2>
<div style="width:100%;text-align:center;">
  {% if perms.core.can_add_student and not archive %}
  <a href="/admin/core/student/add/">{% trans "Add Student" %}</a> |
  {% endif %}
  <a href="{% if archive %}{% url core-students-archive %}{% else %}{% url core-students %}{% endif %}">{% trans "Other" %}</a> |
  {% for c in chars %}
  <a href="{% if archive %}{% url core-students-archive %}{% else %}{% url core-students %}{% endif %}{{ c }}/">{{ c }}</a>
  {% if not forloop.last %} | {% endif %}
  {% endfor %}
  <br />
  <form action="{% if archive %}{% url core-students-archive %}{% else %}{% url core-students %}{% endif %}" method="post">
  {% csrf_token %}
  {% trans "Search" %}: {{ form.group }} {{ form.search }}
  <input type="submit" value="{% trans "Search" %}" />
  </form>
</div>

<script type="text/javascript">
$(document).ready(function() {
  $(".details").hide();
  $("h3").click(function() {
    $(this).next(".details").slideToggle("slow");
    return true;
  });
});
</script>
{% for s in students %}
<h3 title="{% trans "Click for details" %}">
  {{ forloop.counter }}. {{ s.lastname }}, {{ s.firstname }}
  {% if perms.core.can_change_student %}
  <a href="/admin/core/student/{{ s.id }}/">
    <img src="/static/img/edit.png" title="{% trans "Edit" %}" /></a>
  {% endif %}
</h3>
<div class="details">{% include "students/details.html" %}</div>
{% empty %}
<h3>{% trans "No students found." %}</h3>
{% endfor %}

{% endblock %}

